package com.bootdo.common.oss;

/**
 * @author guoyunfei on 2021/12/23 16:34
 * @className OssProcess
 * @description TODO oss 压缩格式
 * @Version 1.0
 */
public class OssProcess {

    //阿里云压缩
    public final static String ALIYUN_COMPRESS = "?x-oss-process=style/q_80";

    //低画质，免广告tu
    public final static String ALIYUN_COMPRESS_NOAD = "?x-oss-process=style/putong";

    //头像
    public final static String ALIYUN_COMPRESS_TX = "?x-oss-process=style/touxiang";

    //阿里云下载压缩
    public final static String ALIYUN_COMPRESS_DOWN = "?x-oss-process=style/down";

    /**
     * 压缩参数
     * @param type
     * @return
     */
    public static String getCompress(String type){
        if("0".equals(type)){
            return null;
        }else  if("1".equals(type)){
            return ALIYUN_COMPRESS;
        }else  if("2".equals(type)){
            return null;
        }
        return null;
    }

    /**
     * 压缩参数,低画质
     * @param type
     * @return
     */
    public static String getCompressNoAd(String type){
        if("0".equals(type)){
            return null;
        }else  if("1".equals(type)){
            return ALIYUN_COMPRESS_NOAD;
        }else  if("2".equals(type)){
            return null;
        }
        return null;
    }

    /**
     * 压缩参数,头像
     * @param type
     * @return
     */
    public static String getCompressTx(String type){
        if("0".equals(type)){
            return null;
        }else  if("1".equals(type)){
            return ALIYUN_COMPRESS_TX;
        }else  if("2".equals(type)){
            return null;
        }
        return null;
    }

    /**
     * 下载压缩参数
     * @param type
     * @return
     */
    public static String getCompressDown(String type){
        if("0".equals(type)){
            return null;
        }else  if("1".equals(type)){
            return ALIYUN_COMPRESS_DOWN;
        }else  if("2".equals(type)){
            return null;
        }
        return null;
    }

}
